package com.ai.ly.goodsautocat.common;

import java.io.File;

import com.ai.ly.goodsautocat.util.ReadWriteFile;
import com.alibaba.fastjson.JSONObject;

import libsvm.svm_model;

public class ModelManager {
    
    public static void saveModel(svm_model model,File file) throws Exception {
        String jsonStr=JSONObject.toJSONString(model);
        if (!file.exists()) {
            file.createNewFile();
        }
        ReadWriteFile.write(file, jsonStr, false);
    }

}
